package collection;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.function.Consumer;

public class LambdaDemo03 {
    public static void main(String[] args) {
        Random random = new Random();
        List<Integer> list1 = new ArrayList<>();
        while (list1.size()<10){
            list1.add(random.nextInt(101));
        }

        for (Integer e:list1) {
            System.out.println(e);
        }

        list1.forEach(new Consumer<Integer>() {
            @Override
            public void accept(Integer integer) {
                System.out.println(integer);
            }
        });

        list1.forEach((integer)->System.out.println(integer));


    }
}
